/*
 * Copyright (c) 2024-2024 Huawei Technologies Co., Ltd. All rights reserved.
 *
 * UniProton is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 * Create: 2024-05-05
 * Description: sbi 接口
 */

#ifndef __SBI_EXT_BASE_H
#define __SBI_EXT_BASE_H


#include "sbi.h"


sbi_ret_t sbi_get_spec_version();


sbi_ret_t sbi_get_impl_id();


sbi_ret_t sbi_get_impl_version();


sbi_ret_t sbi_probe_extension(long exten_id);


sbi_ret_t sbi_get_mvendorid();


sbi_ret_t sbi_get_marchid();


sbi_ret_t sbi_get_mimpid();


sbi_ret_t  sbi_hart_start(unsigned  long  hartid, unsigned long start_addr, unsigned long opaque);


sbi_ret_t  sbi_hart_stop(void);


sbi_ret_t  sbi_hart_get_status(unsigned long hartid);


sbi_ret_t  sbi_hart_suspend(uint32_t suspend_type, unsigned long resume_addr, unsigned long opaque);


sbi_ret_t sbi_debug_console_write(unsigned long num_bytes,   unsigned long base_addr_lo,   unsigned long base_addr_hi);


sbi_ret_t sbi_debug_console_read(unsigned long num_bytes,   unsigned long base_addr_lo,   unsigned long base_addr_hi);


sbi_ret_t sbi_debug_console_write_byte(uint8_t byte);

  
sbi_ret_t sbi_system_suspend(uint32_t sleep_type,   unsigned long resume_addr,   unsigned long opaque);


sbi_ret_t sbi_set_timer(uint64_t stime_value);


sbi_ret_t sbi_send_ipi(unsigned long hart_mask,unsigned long hart_mask_base);

#endif